﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    public partial class form1 : Form
    {
        public form1()
        {
            InitializeComponent();
        }


        private void button1_Click(object sender, EventArgs e)
        {
            button1.Visible = false;
            button2.Visible = true;
            button3.Visible = true;

        }

        private void button2_Click(object sender, EventArgs e)
        {
            button2.Visible = false;
            button3.Visible = false;
            button4.Visible = true;
            label1.Visible = true;
            label2.Visible = true;
            label3.Visible = true;
            label4.Visible = true;
            label5.Visible = true;
            label6.Visible = true;
            label7.Visible = true;
            textBox1.Visible = true;
            textBox2.Visible = true;
            textBox3.Visible = true;
            textBox4.Visible = true;
            listBox1.Visible = true;
        }

        private void button4_Click(object sender, EventArgs e)
        {
            button4.Visible = false;
            label1.Visible = false;
            label2.Visible = false;
            label3.Visible = false;
            label4.Visible = false;
            label5.Visible = false;
            label6.Visible = false;
            label7.Visible = false;
            textBox1.Visible = false;
            textBox2.Visible = false;
            textBox3.Visible = false;
            textBox4.Visible = false;
            listBox1.Visible = false;
            dateTimePicker1.Visible = true;
            label9.Visible = true;
            namelbl.Visible = true;
            addresslbl.Visible = true;
            citylbl.Visible = true;
            statelbl.Visible = true;
            ziplbl.Visible = true;
            namelbl.Text = textBox1.Text;
            addresslbl.Text = textBox2.Text;
            citylbl.Text = textBox3.Text;
            statelbl.Text = listBox1.Text;
            ziplbl.Text = textBox4.Text;
            button6.Visible = true;
            listBox2.Visible = true;
        }

        private void button3_Click(object sender, EventArgs e)
        {
            button2.Visible = false;
            button3.Visible = false;
            button5.Visible = true;
            label8.Visible = true;
            textBox5.Visible = true;
        }

        private void button5_Click(object sender, EventArgs e)
        {
            string input;
            int patientpin;
            input = textBox5.Text;
            patientpin = Convert.ToInt16(input);
            label8.Visible = false;
            textBox5.Visible = false;
                if (patientpin == 1)
                {
                    namelbl.Text = "Homer";
                    addresslbl.Text = "1906 Ash ";
                    citylbl.Text = "Pittsburg";
                    statelbl.Text = "Kansas";
                    ziplbl.Text = "66762";
                    label9.Visible = true;
                    dateTimePicker1.Visible = true;
                    button6.Visible = true;
                    listBox2.Visible = true;
                    button5.Visible = false;
                }
                else if (patientpin == 2)
                {
                    namelbl.Text = "Marge";
                    addresslbl.Text = "219 W Ford";
                    citylbl.Text = "Tulsa";
                    statelbl.Text = "Oklahoma";
                    ziplbl.Text = "56335";
                    label9.Visible = true;
                    dateTimePicker1.Visible = true;
                    button6.Visible = true;
                    listBox2.Visible = true;
                    button5.Visible = false;
                }
                else if (patientpin == 3)
                {
                    namelbl.Text = "Krusty";
                    addresslbl.Text = "1820 S Broadway";
                    citylbl.Text = "Springfield";
                    statelbl.Text = "Kansas";
                    ziplbl.Text = "63029";
                    label9.Visible = true;
                    dateTimePicker1.Visible = true;
                    button6.Visible = true;
                    listBox2.Visible = true;
                    button5.Visible = false;
                }
                else if (patientpin == 4)
                {
                    namelbl.Text = "Bart";
                    addresslbl.Text = "101 W Omaha";
                    citylbl.Text = "Kanarado";
                    statelbl.Text = "Kansas";
                    ziplbl.Text = "61094";
                    label9.Visible = true;
                    dateTimePicker1.Visible = true;
                    button6.Visible = true;
                    listBox2.Visible = true;
                    button5.Visible = false;
                }
                else
                {
                    MessageBox.Show("Invalid Patient Pin Please retry");
                    label8.Visible = true;
                    textBox5.Visible = true;
                }
        }

        private void button6_Click(object sender, EventArgs e)
        {
            label12.Visible = true;
            label13.Text = listBox2.Text;
            label13.Visible = true;
            label14.Visible = true;
            label15.Text = dateTimePicker1.Text;
            label15.Visible = true;
            button6.Visible = false;
            namelbl.Visible = false;
            addresslbl.Visible = false;
            dateTimePicker1.Visible = false;
            listBox2.Visible = false;
            label11.Visible = false;
            citylbl.Visible = false;
            statelbl.Visible = false;
            ziplbl.Visible = false;
            label9.Visible = false;
        }

        private void form1_HelpRequested( object sender, HelpEventArgs hlpevent )
        {
            //this is where I have to implement the action
            HelpMe h = new HelpMe();
            h.Show();
        }
    }
}
